home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / listx / redraw.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-11-12  |  3.0 KB  |  84 lines

  1. VERSION 5.00
  2. Object = "{9FE255D1-F32E-11D0-9E15-444553540000}#1.0#0"; "MLISTX.OCX"
  3. Begin VB.Form Form1 
  4.    Caption         =   "List/X+ Redraw Sample"
  5.    ClientHeight    =   3510
  6.    ClientLeft      =   2085
  7.    ClientTop       =   2025
  8.    ClientWidth     =   4245
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   3510
  11.    ScaleWidth      =   4245
  12.    Begin MabryCtl.MList MList1 
  13.       Height          =   3015
  14.       Left            =   240
  15.       TabIndex        =   0
  16.       Top             =   240
  17.       Width           =   1935
  18.       _ExtentX        =   3413
  19.       _ExtentY        =   5318
  20.       Object.TabStop         =   -1  'True
  21.       MousePointer    =   -1163005939
  22.       ColRowOrder     =   -1  'True
  23.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  24.          Name            =   "MS Sans Serif"
  25.          Size            =   8.25
  26.          Charset         =   0
  27.          Weight          =   400
  28.          Underline       =   0   'False
  29.          Italic          =   0   'False
  30.          Strikethrough   =   0   'False
  31.       EndProperty
  32.       BeginProperty Columns {23BAA6DE-05A6-11D1-9E15-0020AFD6A9D5} 
  33.          ColumnCount     =   1
  34.          BeginProperty Column0 {23BAA6E0-05A6-11D1-9E15-0020AFD6A9D5} 
  35.             Object.Width           =   0
  36.             MinWidth        =   0
  37.             MaxWidth        =   -1
  38.             UserResizeEnabled=   -1
  39.             Heading         =   ""
  40.             Object.Visible         =   -1
  41.             ColumnAlignment =   0
  42.             HeadingAlignment=   0
  43.          EndProperty
  44.       EndProperty
  45.    End
  46.    Begin VB.Label Label2 
  47.       Caption         =   "Look in the Form_Load procedure to see how it's done."
  48.       Height          =   1215
  49.       Left            =   2280
  50.       TabIndex        =   2
  51.       Top             =   1440
  52.       Width           =   1695
  53.    End
  54.    Begin VB.Label Label1 
  55.       Caption         =   "This sample shows how to use the Windows API to disable list painting while adding items. "
  56.       Height          =   1095
  57.       Left            =   2280
  58.       TabIndex        =   1
  59.       Top             =   240
  60.       Width           =   1695
  61.    End
  62. Attribute VB_Name = "Form1"
  63. Attribute VB_GlobalNameSpace = False
  64. Attribute VB_Creatable = False
  65. Attribute VB_PredeclaredId = True
  66. Attribute VB_Exposed = False
  67. Option Explicit
  68. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  69. Const WM_SETREDRAW = &HB
  70. Private Sub Form_Load()
  71.    Dim i As Integer
  72.    Me.Left = (Screen.Width - Me.ScaleWidth) / 2
  73.    Me.Top = (Screen.Height - Me.ScaleHeight) * 2 / 5
  74.    Me.Show
  75.    DoEvents
  76.    ' turn off redraw
  77.    Call SendMessage(MList1.hwnd, WM_SETREDRAW, 0, 0)
  78.    For i = 1 To 1000
  79.       MList1.AddItem "foo" & i
  80.    Next
  81.    ' turn redraw back on, the control redraws automatically
  82.    Call SendMessage(MList1.hwnd, WM_SETREDRAW, -1, 0)
  83. End Sub
  84.